package com.rz.htk.order.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itextpdf.text.Document;
import com.rz.core.resp.ResultResp;
import com.rz.htk.message.entity.Message;
import com.rz.htk.order.entity.Commodity;
import com.rz.htk.order.entity.Order;
import com.rz.htk.order.entity.OrderRecord;
import com.rz.htk.order.entity.excel.CountOrder;
import com.rz.htk.order.entity.vo.OrderDeleteParam;
import com.rz.htk.order.entity.vo.OrderTrackParam;
import com.rz.htk.order.entity.vo.PrintParam;
import com.rz.htk.print.entity.PrintTempField;
import com.rz.htk.template.entity.vo.ExportParam;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface IOrderService extends IService<Order>{

    IPage<Order> getPage(Order order);

    boolean batchDelete(OrderDeleteParam deleteParam);

    boolean saveOrder(Order order);

    boolean saveOrderMessage(OrderDeleteParam deleteParam);
    /**
     * 第三方接口
     * @param order
     * @return
     */
    ResultResp saveOrderGetCode(Order order);

    Order getOrderById(Integer orderId);

    boolean saveImportOrders(List<Order> orders,List<Commodity> commodities, List<OrderRecord> recodes);

    List<String> importOrderExcel(MultipartFile file,Integer crteMngId ,String consumerCode,Integer type) throws IOException;

    boolean updateOrderState(OrderDeleteParam deleteParam);

    List<Order> getByAfterCodes(List<String> codes);

    Map<String,Integer> countOrderTotal(Integer adminId);

    void exportOrder(Order order, OutputStream out);

    int updateTrackSuccess(String afterCode);

    int updatePushYousuSuccess(String afterCode);

    void getByOrderIds(List<Integer> orderIds, OutputStream output);

    void rightCenteralPlace();

    IPage<Order> getSimplePage(Order order);

    Order getOrderByAfterCode(String afterCode);

    Order orderReceiveBack(Integer orderId) throws Exception;

    void downloadTemplateByOrder(List<Integer> orderIds, ServletOutputStream outputStream);
    void downloadTemplateByAfterCode(List<String> afterCodes, ServletOutputStream outputStream);

    Boolean syncOrderTrack(OrderTrackParam param);
    void exportCustomsDeclaration(ExportParam param, OutputStream out);

    boolean saveOrderMessage(Message message, Order order);

    int updateOrderStateByAfterCode(String afterCode,Integer status);
    int udapteOrderAfterCode( String commodityCode,String afterCode);
    boolean updateOrderOut(OrderDeleteParam orderDeleteParam);

    Collection<Order> print(PrintParam printParam);

    List<Order> exportPdfByHtml(List<String> orderCodes);
}
